faiquery
perform interval queries on an indexed fasta file
Description
This is a simple utility library to request interval queries on an indexed fasta file.
Ths index is assumed samtools faidx
.
The fasta file is memory-mapped and a single mutable buffer is kept for the indexed fasta reader. This buffer is used to return a slice reference to the query sequence but allows for a non-contiguous sequence (i.e. can return sequences without newlines)
Note that because a mutable buffer is kept, this is not the best approach for concurrent operations.
However, for single-threaded applications, this performs very well with low memory overhead and runtime.
Usage
use Result;
use ;
Similar Approaches
There are other index fasta readers that are available, here is a nonexhaustive list of those:
If you are looking for a powerful concurrent reader I recommend using the faimm crate.